package net.guerlab.smart.platform.user.core.searchparams;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import net.guerlab.spring.searchparams.AbstractSearchParams;
import net.guerlab.spring.searchparams.OrderByType;
import net.guerlab.spring.searchparams.SearchModel;
import net.guerlab.spring.searchparams.SearchModelType;

import javax.persistence.Column;
import java.time.LocalDateTime;

/**
 * 操作记录搜索参数
 *
 * @author guer
 */
@Setter
@Getter
@ApiModel("操作记录搜索参数")
public class OperationLogSearchParams extends AbstractSearchParams {

    /**
     * 操作记录ID
     */
    @ApiModelProperty("操作记录ID")
    private Long operationLogId;

    /**
     * 应用名称
     */
    @ApiModelProperty("应用名称")
    private String applicationName;

    /**
     * 操作内容关键字
     */
    @ApiModelProperty("操作内容关键字")
    @SearchModel(SearchModelType.LIKE)
    @Column(name = "operationContent")
    private String operationContentLike;

    /**
     * 用户ID
     */
    @ApiModelProperty("用户ID")
    private Long userId;

    /**
     * 用户名
     */
    @ApiModelProperty("用户名")
    private String username;

    /**
     * 姓名关键字
     */
    @ApiModelProperty("姓名关键字")
    @SearchModel(SearchModelType.LIKE)
    @Column(name = "name")
    private String nameLike;

    /**
     * 操作时间开始范围
     */
    @ApiModelProperty("操作时间开始范围")
    @Column(name = "operationTime")
    @SearchModel(SearchModelType.GREATER_THAN_OR_EQUAL_TO)
    private LocalDateTime operationTimeStartWith;

    /**
     * 操作时间结束范围
     */
    @ApiModelProperty("操作时间结束范围")
    @Column(name = "operationTime")
    @SearchModel(SearchModelType.LESS_THAN_OR_EQUAL_TO)
    private LocalDateTime operationTimeEndWith;

    /**
     * 操作时间排序方式
     */
    @ApiModelProperty(hidden = true)
    @JsonIgnore
    @Column(name = "operationTime")
    private OrderByType operationTimeOrderByType = OrderByType.DESC;
}
